
import dto.Profile;
import dto.User;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import util.XMLUtil;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Thinh
 */
public class TestEnviroment {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        List<Profile> profiles = new ArrayList<Profile>();

        Profile profile = new Profile();
        profile.setId(1);
        profile.setAddress("002 C/c Nguyen Van Luong");
        profile.setEmail("gaupoit@outlook.com");
        profile.setFirst_name("Thinh");
        profile.setLast_name("Nguyen");
        profile.setPhone_number("096993938");

        profiles.add(profile);

        User thinh = new User();
        thinh.setId(1);
        thinh.setIs_admin(true);
        thinh.setIs_deleted(false);
        thinh.setUsername("gaupoit");
        thinh.setPassword("123");
        thinh.setProfile(profile);
        try {
            JAXBContext context = JAXBContext.newInstance(User.class);
            XMLUtil.marshallObject(context, thinh, "src/user.xml");
        } catch (JAXBException ex) {
            ex.printStackTrace();
        }
    }

}
